//
//  TMiTunesRedeemerMacro.m
//  TMiTunesRedeemer
//
//  Created by Anshu Chimala on 1/4/10.
//  Copyright 2010 Home. All rights reserved.
//

#import "TMiTunesRedeemerMacro.h"

@implementation TMiTunesRedeemerMacro
@synthesize delegate = _delegate;

- (NSString *)title {
	return @"Redeem iTunes Promo Code";
}

- (NSString *)author {
	return @"Anshu Chimala";
}

- (NSString *)description {
	return @"Redeem an iTunes promo code from your pasteboard. Helpful when people post iPhone promo codes on Twitter.";
}

- (NSString *)beforeText {
	return @"N/A";
}

- (NSString *)afterText {
	return @"N/A";
}

- (void)processText:(NSString *)text {
	_delegate.shouldPasteAfterwards = NO;
	NSURL *iTunesURL = [NSURL URLWithString:
						[@"https://phobos.apple.com/WebObjects/MZFinance.woa/wa/freeProductCodeWizard?code="
						 stringByAppendingString:text]];	
	[[NSWorkspace sharedWorkspace] openURL:iTunesURL];
	[_delegate macro:self didProcessTextWithResult:nil];
}

@end
